package com.heima.feign.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author Lijx
 * @Date 2024-07-26 9:50
 */
@FeignClient(value = "leadnews-schedule")
public interface ITaskClient {

    /**
     * 添加任务
     * @param taskDto
     * @return
     */
    @PostMapping("/api/v1/task/addTask")
    ResponseResult addTask(@RequestBody TaskDto taskDto);

    /**
     * 根据任务优先级和类型拉取任务数据
     * @param taskType
     * @param priority
     * @return
     */
    @GetMapping("/api/v1/task/{taskType}/{priority}")
    ResponseResult pullTask(@PathVariable Integer taskType,
                            @PathVariable Integer priority);
}
